Skip to content

Conversation

@YusukeHirao
Copy link
Member

Summary

  • Add new @d-zero/eslint-plugin package with no-click-event rule
  • Integrate the rule into @d-zero/eslint-config at warn level
  • Add comprehensive tests for all detection patterns

Changes

New Package: @d-zero/eslint-plugin

Created a new ESLint plugin package following monorepo conventions:

  • Rule: no-click-event - Discourages click event handlers in favor of Invoker Commands API
  • Detection patterns:
    • addEventListener('click', ...)
    • element.onclick = ...
    • jQuery .on('click', ...) and .click()
    • React onClick={...}
    • Vue @click and v-on:click

Integration

  • Added @d-zero/eslint-plugin dependency to @d-zero/eslint-config
  • Configured rule in base.js with warn level
  • Applied to all configs: standard, base, node, frontend

Testing

  • Added test fixture: test/fixtures/eslint/no-click-event.ts
  • Added CLI test case verifying 4 warnings
  • All 127 tests passing

Documentation

  • Updated root README.md with new package
  • Added dzero, TSES to cspell dictionary
  • Package README with usage examples

Test Plan

  • Unit tests: 18 test cases in index.spec.ts
  • Integration test: CLI test verifies 4 warnings
  • Build: All packages compile successfully
  • Lint: CSpell, ESLint, TypeScript all pass
  • Total: 127 tests passing

Notes

The Invoker Commands API is a new web standard (Chrome/Edge 135+, Safari TP) that provides a declarative way to handle interactions without JavaScript, improving accessibility and performance.

🤖 Generated with Claude Code

YusukeHirao and others added 4 commits January 20, 2026 14:45
Add @d-zero/eslint-plugin package that provides custom ESLint rules.

Implement no-click-event rule to discourage click event handlers in favor of Invoker Commands API.

Detected patterns:

- addEventListener("click", ...)

- element.onclick = ...

- jQuery .on("click", ...) and .click()

- React onClick={...}

- Vue @click and v-on:click

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add @d-zero/eslint-plugin dependency and configure no-click-event rule in base config.

The rule is enabled at warn level across all configs (standard, base, node, frontend).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add test fixture and CLI test case to verify no-click-event rule detects all patterns.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update root README to include new eslint-plugin package in custom rules section.

Add dzero and TSES to cspell dictionary.

Update yarn.lock with new dependencies.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@YusukeHirao YusukeHirao requested a review from arktds January 20, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants